package com.bcxj.apipassenger.controller;

import com.bcxj.apipassenger.service.VerificationCodeService;
import com.bcxj.internalcommon.dto.VerificationCodeDTO;
import com.bcxj.internalcommon.response.ResponseResult;
import com.bcxj.internalcommon.vo.VerificationCodeVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * ClassName: VerificationCodeController
 * Package: com.bcxj.apipassenger.controller
 * Description:
 *
 * @Author BCXJ
 * @Create 2025/2/10 22:31
 * @Version 1.0
 * @Since 1.0
 */
@RestController
@RequestMapping("/verification-code")
public class VerificationCodeController {

    @Autowired
    private VerificationCodeService verificationCodeService;


    /**
     * 用户登录时需要获取手机验证码
     * @param verificationCodeDTO
     * @return
     */
    @GetMapping("/get")
    public ResponseResult<VerificationCodeVO> getVerificationCode(VerificationCodeDTO verificationCodeDTO) {
        return verificationCodeService.getVerificationCode(verificationCodeDTO);
    }


    @PostMapping("check")
    public ResponseResult checkVerificationCode(@RequestBody VerificationCodeDTO verificationCodeDTO) {

        return verificationCodeService.check(verificationCodeDTO);
    }
}
